package com.wx.chat.model;

import com.alibaba.fastjson.JSONObject;
import lombok.*;

import javax.websocket.Session;

/**
 * 用户的实体类
 *
 * @Auther 田艺鹏
 * @DateTime 2020-08-07 17:57
 */
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class UserEntity {
    private String userId;
    private String password;
    private String headImg;
    private String nickname;
    private Session session;

    public UserEntity(String userId, String password, String nickname, Session session) {
        this.userId = userId;
        this.password = password;
        this.nickname = nickname;
        this.session = session;
    }

    public String getUserInfo(){
        JSONObject users = new JSONObject();
        users.put("userId",userId);
        users.put("headImg",headImg);
        users.put("nickname",nickname);
        return users.toString();
    }
}
